package blog.network;

/**
 * Interface for exporting the progress of a given item
 */
public interface ProgressStatus
{
	public static final int ERR_NO_NETWORK = 1015;

	public static final int ERR_BAD_USER = 1025;

	public static final int ERR_IO = 1035;

	public static final int ERR_USER_HAS_NO_BLOGS = 1045;

	/**
	 * @return The progress of this item, from 0 to 100 
	 */
	public int getProgress();

	/**
	 * Tells the progress generator to reset its progess counter to zero, and clear errs.
	 */
	public void reset();

	/**
	 * @ return Zero if no failure, or the nonzero error code;
	 */
	public int getFailureCode();

	/**
	 * @return True if operation can be cancelled, false if not
	 */
	public boolean isCancellable();

	/**
	 * Attempt to cancel the operation in progress. This may not work 
	 * if isCancellable returns false.
	 */
	public void cancel();

} //interface KProgressStatus
